import Mock from 'mockjs'
// const Mock = require('mockjs')

// 设置响应规则
Mock.mock('/api/login', 'post', () => {
  return {
    code: 200,
    data: {
      id: 1,
      token: 'xxxxx'
    }
  }
})
Mock.mock('/api/users/1', 'get', () => {
  return {
    code: 200,
    data: {
      id: 1,
      name: 'test'
    }
  }
})
Mock.mock('/api/role/1/menu', 'get', () => {
  return {
    code: 200,
    data: [
      {
        id: 38,
        name: '系统管理',
        type: 1,
        url: '/main/system',
        icon: 'el-icon-monitor',
        sort: 1,
        children: [
          {
            id: 39,
            name: 'user',
            type: 2,
            url: '/main/system/user',
            parentId: 38,
            sort: 106,
            children: null
          },
          {
            id: 40,
            name: 'role',
            type: 2,
            url: '/main/system/role',
            parentId: 38,
            sort: 107,
            children: null
          }
        ]
      }
    ]
  }
})
